import java.util.ArrayList;
import java.util.Scanner;
import java.io.BufferedReader;
import java.io.InputStreamReader;

public class ConsoleReader {
	
	private BufferedReader ingreso;
	
	//CONSTRUCTOR
	public ConsoleReader() {
		super();
	    try {
	        ingreso = new BufferedReader(new InputStreamReader(System.in));
	     }
	     catch (Exception e) {
	         e.printStackTrace();
	     }
	}
	
	//toma las palabras ingresadas por pantalla y las retorna en una lista
	public ArrayList<String> getInput() {
		ArrayList<String> res = new ArrayList<String>();
	    try {
	    	System.out.print(">");
	        String lin = ingreso.readLine();
	        Scanner sLin = new Scanner(lin).useDelimiter("[ \t\n\f\r]+"); 
	        while (sLin.hasNext()) {
	           String tok = sLin.next();
	           res.add(tok);
	        }
	     }catch (Exception e) {
	    	 e.printStackTrace();
	     }
	     return res;
	   }
}

